<?php
require './common/utils.php';
$database = require './common/Database.php';

$products=[];
foreach ($database['products'] as $item) {
    $products[]=[
        'id'=>$item['id'],
        'name'=>$item['name'],
        'cover' => parseImgUrl($item['cover']),
        'price' => $item['price'],
    ];
}

$ret = [
    'stat' => 1,
    'msg' => '',
    'data' => $products
];

echo json_encode($ret);
